package com.tools;

import java.awt.Color;
import java.awt.Cursor;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.Action;
import javax.swing.JButton;

public class BICButtonRuban extends JButton {

	private static final long serialVersionUID = 1L;

	public BICButtonRuban() {
		super();
		this.addMouseListener(new RubanMouseListener());
		this.setBackground(BICStyle.getColorGrisClair());
		this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		this.setForeground(Color.WHITE);
		this.setFont(BICStyle.getFontRuban());
	}

	public BICButtonRuban(String text) {
		super(text);
		this.addMouseListener(new RubanMouseListener());
		this.setBackground(BICStyle.getColorGrisClair());
		this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		this.setForeground(Color.WHITE);
		this.setFont(BICStyle.getFontRuban());
	}

	public BICButtonRuban(Action action) {
		super(action);
		this.addMouseListener(new RubanMouseListener());
		this.setBackground(BICStyle.getColorGrisClair());
		this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		this.setForeground(Color.WHITE);
		this.setFont(BICStyle.getFontRuban());
	}

	public class RubanMouseListener extends MouseAdapter {
		public void mouseClicked(MouseEvent e) {
		}

		public void mousePressed(MouseEvent e) {
		}

		public void mouseReleased(MouseEvent e) {
		}

		public void mouseEntered(MouseEvent e) {
			((BICButtonRuban) e.getSource()).setBackground(BICStyle.getColorWhite());
		}

		public void mouseExited(MouseEvent e) {
			((BICButtonRuban) e.getSource()).setBackground(BICStyle.getColorGrisClair());
		}
	}
}
